#if UNITY_EDITOR
using UnityEngine.UIElements;

namespace InternalEditor
{
    public class VisualElementLayout : VisualElement
    {
        public HandleEventDelegate handleEventDelegate;
        public delegate void HandleEventDelegate(EventBase evtBase);

#if UNITY_6000_0_OR_NEWER
        protected override void HandleEventBubbleUp(EventBase evtBase)
        {
            handleEventDelegate?.Invoke(evtBase);
        }
#elif UNITY_2021_1_OR_NEWER
        public override void HandleEvent(EventBase evt)
        {
            base.HandleEvent(evt);
            handleEventDelegate?.Invoke(evt);
        }
#else
        internal override void HandleEventEditorInternal(EventBase evtBase)
        {
            handleEventDelegate?.Invoke(evtBase);
        }
#endif
    }
}
#endif